setClass("SilhIClusterScore",contains="InternalClusterScore",
		prototype=prototype(
				.description="Silhouette Cluster Internal Score class"
		
		)
)  

#global functions
#methods

#calclustes silhouette index for given clusterization
setMethod("ScoreSet",
		signature="SilhIClusterScore",
		definition=function(.Object,inputSet,clusters,...){
			#check for X and clusters
			callNextMethod(.Object,inputSet,clusters,...)
			if(isOneCluster(clusters)){return(-.Machine$double.xmax)}
			
			silh <- index.S(dist(inputSet$X),clusters)
			
			return(silh) #[-1;1] 1-good clustered; -1 bad clustered
		}
)  
